package com.jr.serviceimpl;

import com.jr.dao.UserDao;
import com.jr.daoimpl.UserDaoImpl;
import com.jr.entity.Users;
import com.jr.pojo.UserEnterprise;
import com.jr.service.UserService;

import java.util.ArrayList;

public class UserServiceImpl implements UserService {

    UserDao userDao = new UserDaoImpl();

    @Override
    public Users findUser(String account, String password) {
        return userDao.selectUser(account,password);
    }


    @Override
    public boolean login(String account, String password) {
        ArrayList<Users> list = userDao.login(account, password);
        if(list.size()>0){
            return  true;
        }else{
            return false;
        }
    }

    @Override
    public UserEnterprise select(String account, String password) {
        return userDao.select(account, password);
    }


    @Override
    public boolean adduser(int enterprise_id, String ename,String account,String password,String idcard_name, String idcard_no) {
        return userDao.adduser(enterprise_id,ename,account,password,idcard_name,idcard_no)>0;
    }
}
